package cn.stylefeng.guns.sys.modular.system.service;

import cn.stylefeng.guns.base.pojo.page.LayuiPageInfo;
import cn.stylefeng.guns.sys.modular.system.entity.ZxChengbenMingxi;
import cn.stylefeng.guns.sys.modular.system.model.params.ZxChengbenMingxiParam;
import cn.stylefeng.guns.sys.modular.system.model.result.ZxChengbenMingxiResult;
import cn.stylefeng.guns.sys.modular.system.model.result.ZxTzqkViewResult;
import cn.stylefeng.roses.core.reqres.response.ResponseData;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.http.ResponseEntity;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author modular/system
 * @since 2020-11-19
 */
public interface ZxChengbenMingxiService extends IService<ZxChengbenMingxi> {

    /**
     * 新增
     *
     * @author modular/system
     * @Date 2020-11-19
     */
    ResponseData add(ZxChengbenMingxiParam param);

    ResponseData addNewItem(ZxChengbenMingxiParam param);

    ResponseData addMany(ZxChengbenMingxiParam param);

    /**
     * 供货商保存报销单
     * @param param
     * @return
     * by zwf 20210116
     */
    ResponseData addNewItemGhs(ZxChengbenMingxiParam param);

    /**
     * 删除
     *
     * @author modular/system
     * @Date 2020-11-19
     */
    boolean delete(ZxChengbenMingxiParam param);


    /**
     * 删除-供货商
     *
     * @author zwf
     * @Date 2021-01-18
     */
    boolean deleteGhs(ZxChengbenMingxiParam param);

    /**
     * 更新
     *
     * @author modular/system
     * @Date 2020-11-19
     */
    void update(ZxChengbenMingxiParam param);
    ResponseData update2(ZxChengbenMingxiParam param);
    ResponseData updateGhs(ZxChengbenMingxiParam param);


    /**
     * 查询单条数据，Specification模式
     *
     * @author modular/system
     * @Date 2020-11-19
     */
    ZxChengbenMingxiResult findBySpec(ZxChengbenMingxiParam param);

    /**
     * 查询列表，Specification模式
     *
     * @author modular/system
     * @Date 2020-11-19
     */
    List<ZxChengbenMingxiResult> findListBySpec(ZxChengbenMingxiParam param);

    /**
     * 查询分页数据，Specification模式
     *
     * @author modular/system
     * @Date 2020-11-19
     */
    LayuiPageInfo findPageBySpec(ZxChengbenMingxiParam param);

    ResponseData obtainFromBaoxiaodan(ZxTzqkViewResult param);

    List<ZxChengbenMingxiResult> selectAllMingXiUnderLevel(ZxChengbenMingxiParam param);

    List<ZxChengbenMingxiResult> selectAllMingXiAndKemuInfo();

    ResponseData btnImportMdbx(MultipartFile file, Long btyZxChengbenId) throws IOException;

    ResponseData createDakuandan(ZxChengbenMingxiParam param);
    ResponseData tijiaobaoxiaoGhs(ZxChengbenMingxiParam param);
    ResponseData tijiaobaoxiaoGhsTh(ZxChengbenMingxiParam param);

    ResponseData queryCreateUser();

    void updateKemuByHuopinId(String btyZxHuopinId);

    /**
     * 科目同步
     * 逻辑
     * 1、根据关键字同步货品的科目
     * 2、同步没有科目的报销单明细
     * @param zxChengbenMingxiParam
     * @return
     */
    ResponseData kemuTongbu(ZxChengbenMingxiParam zxChengbenMingxiParam);

    boolean choudian(ZxChengbenMingxiParam zxChengbenMingxiParam);

    void shenheTijiao(ZxChengbenMingxiParam zxChengbenMingxiParam) throws Exception;

    /**
     * 按单号进行审批
     * @param param
     * @return
     */
    ResponseData shenpiByDanhao(ZxChengbenMingxiParam param);

    boolean buchoudian(ZxChengbenMingxiParam zxChengbenMingxiParam);

    void updateStatusNull();

    void updateBySpec(ZxChengbenMingxiParam param);

    ResponseEntity<byte[]> exportMx(HttpServletRequest request, HttpServletResponse resposne, ZxChengbenMingxiParam param);

    void updateMendian(String id, String btyZxMdzxId);

    /**
     * 合并门店
     * @param zxChengbenMingxiParam
     * @return
     */
    ResponseData mergeMendian(ZxChengbenMingxiParam zxChengbenMingxiParam);

    /**
     * 删除报销单
     *
     */
    boolean deleteBxd(ZxChengbenMingxiParam param);

    Boolean importMx(String fileName, MultipartFile file) throws Exception;

    List<ZxChengbenMingxiResult> customList(ZxChengbenMingxiParam param);

}
